package netmorph.model.parts;

import netmorph.model.NetmorphModel;
import model.AbstractModel;
import neuron.NetworkStatistics;

public class TuftBEPart extends NetmorphModelBESPart {

	public TuftBEPart(BESInputModel input, BESOutputModel output, NetmorphModel model) 
	{
		super(input, output, model);
	}

	@Override
	public void init() {
		x = new double[]{ input.getTuftB(), input.getTuftE() };
		y = new double[2];
		yt = new double[] { output.getTargetTTSMean(), output.getTargetTTSDev() };
	}

	@Override
	public void setParameters() {
		input.setTuftB(x[0]);
		input.setTuftE(x[1]);
	}

	@Override
	public void modelComputed(NetmorphModel model) {
		xDist = model.getLastStats().tuftTermSegCountDist();
		double curNTS = model.getLastStats().tuftTermSegCountDist().mean();
		double curNTSDev = model.getLastStats().tuftTermSegCountDist().stdev();
		y = new double[] { curNTS, curNTSDev };
	}

	@Override
	public boolean isDone() {
		return true;
	}

	@Override
	public String getName() {
		return "TuftBE";
	}
}
